//
//  BCRouter.h
//  BCRouter_Example
//
//  Created by 蔡亮 on 2019/3/25.
//  Copyright © 2019年 bruce. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef void (^BCRouterHandler)(NSDictionary *params);
typedef id (^BCObjectRouterHandler)(NSDictionary *params);

typedef void (^BCRouterCallback)(id callbackObjc);
typedef void (^BCCallbackRouterHandler)(NSDictionary *routerParameters,BCRouterHandler targetCallback);

typedef void (^BCRouterUnregisterURLHandler)(NSString *routerURL);
NS_ASSUME_NONNULL_BEGIN

@interface BCRouter : NSObject
//1.注册 block不带参数
+ (void)registerRouterURL:(NSString *)url handler:(BCRouterHandler)handler;
//2.注册 block带返回参数
+ (void)registerObjectRouterURL:(NSString *)url handler:(BCObjectRouterHandler)handler;
//3.注册 block带block
+ (void)registerCallbackRouterURL:(NSString *)url handler:(BCCallbackRouterHandler)handler;

//4. can router
+ (BOOL)canRouterURL:(NSString *)url;
//5. routerTo
+ (void)routerToURL:(nullable NSString *)url;
//6. routerToURL:Params:
+ (void)routerToURL:(NSString *)url params:(nullable NSDictionary *)routerParams;

//7.routeObjectURL 返回一个object
+ (id)routerObjectURL:(NSString *)url;
//8.routeObjectURL:Params: 返回一个object
+ (id)routerObjectURL:(NSString *)url params:(nullable NSDictionary *)routerParmas;

//9.routerCallbackURL:targetCallback:
+ (void)routerCallbackURL:(NSString *)url targetCallback:(BCRouterCallback)targetCallback;
//10.routerCallbackURL:params:targetCallback:
+ (void)routerCallbackURL:(NSString *)url params:(nullable NSDictionary<NSString *,id> *)routerParms targetCallback:(BCRouterCallback)targetCallback;

//11.remeveAllRouter
+ (void)removeAllRouter;
//12.removeOneRouter
+ (void)removeRouterWithURL:(NSString *)url;
@end

NS_ASSUME_NONNULL_END
